﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PropertyApp.cs
{
    public partial class PropertyAppForm : Form
    {
        public PropertyAppForm()
        {
            InitializeComponent();
        }

        private void buttonClose_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void buttonConfig_Click(object sender, EventArgs e)
        {
            PropertyForm dialog = new PropertyForm();
            dialog.Owner = this;

            dialog.POP3 = this.textBoxPOP3.Text;
            dialog.SMTP = this.textBoxSMTP.Text;

            dialog.ApplyHendler += new EventHandler(PropertyForm_Apply);

            dialog.Show();
        }

        private void PropertyForm_Apply(object sender, EventArgs e)
        {
            PropertyForm dialog = (PropertyForm)sender;

            this.textBoxPOP3.Text = dialog.POP3;
            this.textBoxSMTP.Text = dialog.SMTP;
        }
    }
}
